package com.lagou.cluster.util;

import org.springframework.util.DigestUtils;

/**
 * @ProjectName: S2-2
 * @Title: SimpleMD5Util
 * @Package: com.lagou.cluster.util
 * @Description: MD5工具
 * @author: Ian
 * @date: 2021-04-01 17:12
 * @version: V1.0.0
 */
public class SimpleMD5Util {
    // md5盐
    private static final String SLAT = "~!@#$%^&*()_+";

    /**
     * 生成md5
     *
     * @param data 明文字符串
     * @return
     */
    public static String getMD5(String data) {
        String base = data + "/" + SLAT;
        return DigestUtils.md5DigestAsHex(base.getBytes());
    }

}
